* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*    Age Gap, Age and Gender Ratios
*		3/15/22
* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


use "PakistanCensusGenderRatio.dta", clear

* %%%%%%%% Gender ratio graphs %%%%%%
* %%%%%%% Figure A8 %%%%%%%%%%%%

* Urban Gender Ratio by Age, 1998 and 1981, using female/male
tw (line gratiou Age2 if year==1981 & Age2~=17, lp(dash) lcolor(black)) ///
(line gratiou Age2 if year==1998 & Age2~=17, lcolor(black)    /// 
ytitle("Gender Ratio") xtitle("Age") ylabel(0.4(0.2)1.6) xlabel(1 5 10 15, valuelabel) yline(1) ///
	graphregion(color(white)) plotregion(fcolor(white) lcolor(black))  ///
	legend(order(1 "1981" 2 "1998"))) 

graph export 

* Using female/male(n+1)
tw (line gratiou2 Age2 if year==1981 & Age2<16, lp(dash) lcolor(black)) ///
(line gratiou2 Age2 if year==1998 & Age2<16, lcolor(black)    /// 
ytitle("Gender Ratio") xtitle("Age") ylabel(0.4(0.2)1.6) xlabel(1 5 10 15, valuelabel) yline(1) ///
	graphregion(color(white)) plotregion(fcolor(white) lcolor(black))  ///
	legend(order(1 "1981" 2 "1998")))
	
graph export 


* %%%%%%%% Age Gap and Ads %%%%%%
* %%%%%%%% Table A11 %%%%%%

use "AdsGenderRatioMerged.dta", clear

estimates clear
areg numdem gratiou asker_age agesq anylooksself ///
 anystatusself_s anyethnicityself ///
 anyreligionself anyoccself anyeducself ///
 if askermale==1 & asker_age<50 & anyforeignself==0 & anyforeignwanted==0, ///
	absorb(year) vce(cluster year)	

estimates store e1 

areg numdem gratiou asker_age agesq anylooksself ///
 anystatusself_s anyethnicityself ///
 anyreligionself anyoccself anyeducself ///
 if askermale==0 & asker_age<50 & anyforeignself==0 & anyforeignwanted==0, ///
	absorb(year) vce(cluster year)	

estimates store e2 
	
areg numdem gratiou2 asker_age agesq anylooksself ///
 anystatusself_s anyethnicityself ///
 anyreligionself anyoccself anyeducself ///
 if askermale==1 & asker_age<50 & anyforeignself==0 & anyforeignwanted==0, ///
	absorb(year) vce(cluster year)	

estimates store e3 

areg numdem gratiou2 asker_age agesq anylooksself ///
 anystatusself_s anyethnicityself ///
 anyreligionself anyoccself anyeducself ///
 if askermale==0 & asker_age<50 & anyforeignself==0 & anyforeignwanted==0, ///
	absorb(year) vce(cluster year)	
estimates store e4

areg askeelength gratiou asker_age agesq anylooksself ///
 anystatusself_s anyethnicityself ///
 anyreligionself anyoccself anyeducself ///
 if askermale==1 & asker_age<50 & anyforeignself==0 & anyforeignwanted==0, ///
	absorb(year) vce(cluster year)	
estimates store e5 

areg askeelength gratiou asker_age agesq anylooksself ///
 anystatusself_s anyethnicityself ///
 anyreligionself anyoccself anyeducself ///
 if askermale==0 & asker_age<50 & anyforeignself==0 & anyforeignwanted==0, ///
	absorb(year) vce(cluster year)	
estimates store e6 


areg askeelength gratiou2 asker_age agesq anylooksself ///
 anystatusself_s anyethnicityself ///
 anyreligionself anyoccself anyeducself ///
 if askermale==1 & asker_age<50 & anyforeignself==0 & anyforeignwanted==0, ///
	absorb(year) vce(cluster year)	
estimates store e7


areg askeelength gratiou2 asker_age agesq anylooksself ///
 anystatusself_s anyethnicityself ///
 anyreligionself anyoccself anyeducself ///
 if askermale==0 & asker_age<50 & anyforeignself==0 & anyforeignwanted==0, ///
	absorb(year) vce(cluster year)	
estimates store e8

esttab e1 e2 e3 e4 e5 e6 e7 e8 

